'use strict';
const requireEx=require('yi-require');
const $ = requireEx('yi-schema');
module.exports = {
  query: $.object({
    page: $.object({
      size: $.number().integer().positive().default(10),
      index: $.number().integer().positive().default(1)
    }),
    filter: $.object({
      _id:$.object({$in:$.array().items($.mongoid())}).description("卡片id数组"),
      title:$.string().min(1).max(6).description("标题"),
      latitude:$.number().description("纬度"),
      longitude:$.number().description("经度"),
      place:$.string().min(1).description("地点"),
      cardKindID:$.mongoid().description("卡片种类ID"),
      authorID:$.mongoid().description("作者ID"),
      headPicPath:$.string().description("头像图片路径"),
      nickname:$.string().min(1).max(16).description("昵称"),
      likeID:$.object({"$in":$.array().items($.mongoid())}).description("点赞者ID"),
      checkState:$.number().valid(0,1).description("审核状态，1：审核通过，0：审核不通过，默认1"),
      createTime:$.object({
          $gt:$.date(),
          $lt:$.date()
      }).description("创建时间")
    }),
    project: $.object({
      picPath:$.number().valid(0,1),
      soundPath:$.number().valid(0,1),
      title:$.number().valid(0,1),
      latitude:$.number().valid(0,1),
      longitude:$.number().valid(0,1),
      place:$.number().valid(0,1),
      cardKindID:$.number().valid(0,1),
      authorID:$.number().valid(0,1),
      headPicPath:$.number().valid(0,1),
      nickname:$.number().valid(0,1),
      // careID:$.number().valid(0,1),
      likeID:$.number().valid(0,1),
      commentID:$.number().valid(0,1),
      checkState:$.number().valid(0,1),
      createTime:$.number().valid(0,1)
    }),
    sort: $.object({
      createTime: $.number().valid(-1, 1)
    })
  })
};